<?php

namespace App\Console;

use App\Console\Commands\orderRecive;
use App\Console\Commands\userAutoOrder;
use App\Console\Commands\userSpreads;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
        userSpreads::class,
        orderRecive::class,
        userAutoOrder::class
    ];

    /**
     * Define the application's command schedule.
     *
     * @param Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //团队升级

        $schedule->command('user_spread_tuan')->everyFiveMinutes();//每5分钟执行一次同步团队
        $schedule->command('order_recive')->everyMinute();//每分钟执行一次订单发放奖励
        $schedule->command('user_auto_order')->everyMinute();//每分钟执行一次订单发放奖励
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
